[mirrors]
http://dev.gentoo.org/~blueness/eudev/eudev-1.3.tar.gz

[vars]
filesize=1679385
sha512=5e0016fbe15eebfa68bb04fa7b5aedd7edc7a508afdc030adb7cbec4e9eca84fe16119ca73f5724ec290ad4bba179b42d2d0bc56f3aaf2a07e3c48b18374b3b3

[deps]
kernel-headers
libblkid
glib

[build]
patch -p1 < "$K"/eudev-Handle-1-return-from-sysconf.patch

[ -n "$CROSS_COMPILE" ] && \
  xconfflags="--host=$($CC -dumpmachine) --with-sysroot=$butch_root_dir"

# https://github.com/gentoo/eudev/issues/75
# https://github.com/gentoo/eudev/issues/70
CFLAGS="-D_GNU_SOURCE $optcflags" \
LDFLAGS="$optldflags -lblkid" \
  ./configure -C --prefix="$butch_prefix" $xconfflags \
  --disable-manpages \
  --disable-keymap \
  --disable-blkid \
  --disable-introspection \


patch -p1 < "$K"/libtool-sysroot.patch

make -j$MAKE_THREADS V=1
make DESTDIR="$butch_install_dir" install

dest="$butch_install_dir""$butch_prefix"
# prevent renaming of ethernet interfaces
ln -s /dev/null "$dest"/etc/udev/rules.d/80-net-name-slot.rules
printf "%s\n" 'KERNEL=="kvm", NAME="%k", GROUP="kvm", MODE="0660"' \
 > "$dest"/etc/udev/rules.d/65-kvm.rules
mkdir -p "$dest"/lib/pkgconfig
mv "$dest"/share/pkgconfig/* "$dest"/lib/pkgconfig/
rm -rf "$dest"/share/pkgconfig

